package STUDENT.DAODUCGIANG.BASIC.MY_FIRST_JAVA_PROGRAM;

import java.util.Scanner;

public class P2_5 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	
	System.out.println("Xin nhap ho ten cua ban");
	String Name = sc.nextLine();
	if (Name .isEmpty()){
		System.out.println("Ban phai nhap ten cua ban");
		return;
	}
	
	System.out.println("Xin nhap tuoi cua ban");
	String AgeTemp = sc.nextLine();
	if (AgeTemp .isEmpty()){
		System.out.println("Ban phai nhap tuoi");
		return;
	}
	byte Age = Byte.parseByte(AgeTemp); 
	
	System.out.println("Xin nhap tinh trang hon nhan: 0-doc than, 1-da ket hon, 2-ly hon");
	String MarriageTemp = sc.nextLine();
	if (MarriageTemp .isEmpty()){
		System.out.println("Ban phai nhap tinh trang hon nhan");
		return;
	}
	byte Marriage = Byte.parseByte(MarriageTemp);
	
	System.out.println("Xin nhap gioi tinh cua ban: 0-nam, 1-nu");
	String SexTemp = sc.nextLine();
	if (SexTemp .isEmpty()){
		System.out.println("Ban phai nhap gioi tinh");
		return;
	}
	byte Sex = Byte.parseByte(SexTemp);
	
	if (Sex == 0 && Age >= 22 && (Marriage == 0 || Marriage == 2)){
		System.out.println("Chuc mung ban dang ky thanh cong");
	}
		else {
			System.out.println("Rat tiec ban khong du dieu kien");
		}
	}
	
	
}
